﻿@model PagedList.IPagedList<SIBI.Models.Movimiento>

@{
    ViewBag.Title = "Movimiento";
}

@*//***********************************************************************************//
  //****                        INICIO  PROYECTO SIBI V.1.0                         ***//
  //****                             Adrian Di Puglia                               ***//
  //***********************************************************************************//*@
<h2>Movimientos</h2>

<script src="@Url.Content("~/Scripts/myScript2.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


@ViewBag.msnCorreo
@*<div class="error">
@ViewBag.HijosChange
</div>*@
@*<div class="error">
@ViewBag.Seriales
</div>
*@
    @using (Html.BeginForm()){   
         <p>

            <table width="100%">
                    <tr>
                        <td width="33%"> 
                            Serial:<br /> @Html.TextBox("SearchSerial", ViewBag.CurrentSerial as string)&nbsp;
                        </td>
                        <td width="33%">
                            Causa Movimiento: <br /> @Html.TextBox("SearchCausa", ViewBag.CurrentCausa as string) &nbsp;
                        </td> 
                        <td width="33%">
                            Ubicación Física: <br /> @Html.TextBox("SearchUbi", ViewBag.CurrentUbi as string) &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Fecha Desde Movimiento:<br />  @Html.TextBox("SearchFechaIni", ViewBag.CurrentFechaIni as DateTime?) &nbsp;         
                            <label for="SearchFechaIni" generated="true" class="error"></label>
                        </td>
                        <td>
                            Fecha Hasta Movimiento:<br />  @Html.TextBox("SearchFechaFinal", ViewBag.CurrentFechaFinal as DateTime?) &nbsp;
                            <label for="SearchFechaFinal" generated="true" class="error"></label>
                        </td> 
                    </tr>

            </table>
         <input type="submit" value="Filtrar" /></p>
    }
        </p>
<table width="100%">
    <tr>
        <th>
            Serial
        </th>
        <th>
            Fecha Movimiento
        </th>
        <th>
            Clase Objeto
        </th>
        <th>
            Tipo Movimiento
        </th>
        <th>
            Localidad
        </th>
        <th>
            Ubicación Física
        </th>
        <th>
            Causa Movimiento
        </th>
        <th>
            Observación
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.nbin.BienInformaticoId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.dfmo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nbin.nmym.ncob.cnom)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ctmo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.localidad_id)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.cubf)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ncmo.cnom)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.cobs)
        </td>
        <td>
            @Html.ActionLink("Editar", "Edit", new { id = item.MovimientoId }) |
            @Html.ActionLink("Detalles", "Details", new { id=item.MovimientoId })
        </td>
    </tr>
}

</table>

<br />

<div>
    Pag @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    de @Model.PageCount
    &nbsp;
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<= ", "SearchIndex", new { page = 1, currentSerial = ViewBag.CurrentSerial, currentFechaIni = ViewBag.CurrentFechaIni, currentFechaFinal = ViewBag.CurrentFechaFinal, currentUbi = ViewBag.CurrentUbi, currentCausa = ViewBag.CurrentCausa })
        @Html.Raw("&nbsp;");
        @Html.ActionLink("<=", "SearchIndex", new { page = Model.PageNumber - 1, currentSerial = ViewBag.CurrentSerial, currentFechaIni = ViewBag.CurrentFechaIni, currentFechaFinal = ViewBag.CurrentFechaFinal, currentUbi = ViewBag.CurrentUbi, currentCausa = ViewBag.CurrentCausa })
    }
    else
    {
        @:<<=
        @Html.Raw("&nbsp;");
        @:<=
    }
    &nbsp;
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("=>", "SearchIndex", new { page = Model.PageNumber + 1, currentSerial = ViewBag.CurrentSerial, currentFechaIni = ViewBag.CurrentFechaIni, currentFechaFinal = ViewBag.CurrentFechaFinal, currentUbi = ViewBag.CurrentUbi, currentCausa = ViewBag.CurrentCausa })
        @Html.Raw("&nbsp;");
        @Html.ActionLink(" =>>", "SearchIndex", new { page = Model.PageCount, currentSerial = ViewBag.CurrentSerial, currentFechaIni = ViewBag.CurrentFechaIni, currentFechaFinal = ViewBag.CurrentFechaFinal, currentUbi = ViewBag.CurrentUbi, currentCausa = ViewBag.CurrentCausa })
    }
    else
    {
        @:=>
        @Html.Raw("&nbsp;")
        @:=>>
    }
</div>

@*//***********************************************************************************//
  //****                          FIN  PROYECTO SIBI V.1.0                          ***//
  //***********************************************************************************//*@